import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'

const routes:Array<RouteRecordRaw> = [
    {
        path:"/",
        component:()=> import('../LoginViews/SelectRole.vue')
    },
    {
        path:"/login",
        component:()=> import('../LoginViews/Login.vue')
    },
    {
        path:"/business/listShops",
        component:()=> import('../BusinessViews/listShops.vue')
    },
    {
        path:"/business/listShopItems",
        component:()=> import('../BusinessViews/listShopItems.vue')
    },
    {
        path:"/business/listOrders",
        component:()=> import('../BusinessViews/listOrders.vue')
    },
    {
        path:"/customer/browseAllShop",
        component:()=> import('../CustomerViews/browseAllShop.vue')
    },
    {
        path:"/customer/browseShopItem",
        component:()=> import('../CustomerViews/browseShopItem.vue')
    },
    {
        path:"/customer/pay",
        component:()=> import('../CustomerViews/pay.vue')
    },
    {
        path:"/customer/myOrder",
        component:()=> import('../CustomerViews/MyOrders.vue')
    },

    // {
    //     path:"/customer/browseAllShop",
    //     component:()=> import('../CustomerViews/browseAllShop.vue')
    // },
    // {
    //     path:"/businessList",
    //     component:()=> import('../CustomerViews/BusinessList.vue')
    // },
    // {
    //     path:"/historyOrders",
    //     component:()=> import('../CustomerViews/OrderList.vue')
    // },
    // {
    //     path:"/register",
    //     component:()=> import('../CustomerViews/Register.vue')
    // },
    // {
    //     path:"/orders",
    //     component:()=> import('../CustomerViews/Orders.vue')
    // },
    // {
    //     path:"/userAddress",
    //     component:()=> import('../CustomerViews/UserAdress.vue')
    // },
    // {
    //     path:"/payment",
    //     component:()=> import('../CustomerViews/Payment.vue')
    // },
    // {
    //     path:"/addUserAddress",
    //     component:()=> import('../CustomerViews/AddUserAddress.vue')
    // },
    // {
    //     path:"/editUserAddress",
    //     component:()=> import('../CustomerViews/EditUserAdress.vue')
    // },
    {
        path:"/test",
        component:()=> import('../CustomerViews/Test.vue')
    },
]

const router = createRouter({
    history:createWebHistory(),
    routes
})

export default router
//把上面创建的router 传出去
//然后需要在main.ts注册一下这个router, 因为它相当于一个插件